<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * region short summary.
 *
 * region description.
 *
 * @version 1.0
 * @author GALAXY
 */
class Region_model  extends CI_Model
{
    public $region_id;
    public $region_name;
    public $region_code;
    public $level_id;
    public $father_id;
    public $sort;
    public $dr;
    public function __construct()
    {
        parent::__construct();
        $this->load->database();
    }

    public function get_province()
    {
        $sql="select * from region where father_id=0 order by region_code asc";
        return $this->db->query($sql)->result(); 
    }

    public function get_region_id($region_id)
    {
        $sql="select * from region where father_id=$region_id order by region_code asc";
        return $this->db->query($sql)->result_array();
    }
}